<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class OverdueCommonMail extends Mailable
{
    use Queueable, SerializesModels;

    private $path;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($path)
    {
        $this->path = $path;
    }

    /**
     * Description:平台逾期数据邮件
     * Author: Mmy
     * DateTime: 2019-03-14 19:12
     * @return OverdueCommonMail
     */
    public function build()
    {
        $date = date('Ymd', strtotime('-1 day'));
        return $this->view('mail.overdue', ['data' => $date. '平台逾期数据，请查收'])->attach($this->path, [
            'as' => $date . '平台逾期数据.xlsx'
        ]);
    }
}
